<?php defined('IN_YuLin') || exit('NO PERMIT!'); ?>
{template index/header}
	<div class="container containerUser fix pt15">
		{template member/slide}
		<div class="userRight">
			<div class="userTitle mgb10">下级开户</div> 
			<div class="userMain openAgent mgb10">
				<div class="newTab">
					<a href="javascript:void(0);" class="curr curr">下级开户</a> 
					<a href="{U('member/manageInvite', array('operation'=>'managecode'))}" class="">邀请码管理</a>
				</div> 
				<div data-id="1" data-title="" class="TabLi">
					<ul class="searchFirst">
						<li>
							<span>开户类型：</span> 
							<a href="javascript:;" class="userSearch active" amv="1">代理</a> 
							<a href="javascript:;" class="userSearch" amv="2">玩家</a> 
							<br> 
							返点设置：请先为下级设置返点。 
							<a class="rebateDesLink">点击查看返点赔率表</a>
						</li>
					</ul> 
					<div id="NextOpen" class="bonusTable">
						{loop $cateList as $k => $v}
							<ul>
    							<li>{$v['name']}</li> 
    							<li>
    								<input type="number" name="lott[{$k}]" tag="{$v['name']}返点" ami="{$k}" placeholder="" min="0.0" step="0.1" max="{$rpsInfo[$k]['re_point']}" class="userInput mgl20 tag_set_lott_rps">&nbsp;
    								<span>（自身返点{$rpsInfo[$k]['re_point']}，可为下级设置返点范围0.0-{$rpsInfo[$k]['re_point']}）</span>
    							</li>
    						</ul>
						{/loop}
					</div> 
					<a class="submitBtn tag_create_rps">生成邀请码</a> 
					<div class="userTip mg30">
						<p>※ 温馨提示：
                            <br> 1、不同的返点赔率不同，返点越高赔率越高。
                            <br> 2、代理可获得的佣金等于代理自身返点与下级返点的差值，如代理自身返点6，下级返点4，代理可获得下级投注金额的2%，即下级下注100元，代理可获得2元。
                            <br> 3、下级返点值设得越低，下级的赔率就越低，建议给下级设置的返点不要过低。
                        </p>
                    </div>
                </div>
            </div>
        </div>
	</div>
	<script src="static/js/member/member_common_func.js"></script>
	<script>
		$('.userSearch').on('click', '', function (){
			$('.userSearch').removeClass('active');
			$(this).addClass('active');
		})
		
		$('.tag_create_rps').on('click', '', function (){
			var type = '';
			$.each($('.userSearch'), function (i, v){
				if ($(v).hasClass('active')){
					type = $(this).attr('amv');
					return false;
				}
			})
			var rps   = new Object();
			var param = {'type': type, 'rps':rps, 'operation':'createRps'};
			$.each($('.tag_set_lott_rps'), function (i, v){
				if($.isEmptyObject( $(v).val() )) {
					showMsg('温馨提示', '请对每一个彩种设置返点数值');
					return false;
				}
				param.rps[$(v).attr('ami')] = $(v).val();
			})
			postRequest("{U('json/func_member')}", param);
		})
	</script>
{template index/footer}